class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users do |table|
      table.column :name, :string, :limit => 50, :null => false
      table.column :hashed_password, :string, :limit => 40, :null => false
      table.column :level, :integer, :null => false, :default => 0
      table.column :first_name, :string, :limit => 50, :null => false
      table.column :last_name, :string, :limit => 50, :null => false
      table.column :email, :string, :limit => 50, :null => false
      table.column :street, :string, :limit => 50, :null => false
      table.column :city, :string, :limit => 50, :null => false
    end
    User.create :name => 'qqqqq', :password => 'qqqqq', :password_repeat => 'qqqqq', :level => 1, :first_name => 'Max', :last_name => 'Walther', :email => 'qqqqq@gnome4giant.com', :street => 'Strasse 5', :city => 'Dresden'
  end
  
  def self.down
    drop_table :users
  end
end